/*
 * @(#)IsInParameter.java   1.0   May 11, 2007
 *
 * Copyright 2000-2007 ETH Zurich. All Rights Reserved.
 *
 * This software is the proprietary information of ETH Zurich.
 * Use is subject to license terms.
 *
 * @(#) $Id: IsInParameter.java 412 2007-05-11 15:46:21Z D\aldespin $
 */
package ch.ethz.globis.javaom.collection.imp;

import ch.ethz.globis.javaom.collection.ReduceParameter;

/**
 * @author aldespin
 * @version 1.0
 */
public class IsInParameter implements ReduceParameter {

   private Object arg;

   public IsInParameter(final Object arg) {
      this.arg = arg;
   }

   /**
    * {@inheritDoc}
    */
   public Object isEmpty() {
      return Boolean.FALSE;
   }

   /**
    * {@inheritDoc}
    */
   public Object isSingle(final Object member) {
      return new Boolean(member.equals(this.arg));
   }

   /**
    * {@inheritDoc}
    */
   public Object combine(Object lhs, Object rhs) {
      return new Boolean(((Boolean) lhs).booleanValue() || ((Boolean) rhs).booleanValue());
   }

}
